<template>
    <div class="top_err_box">
        <v-alert
                type="error"
                v-model="show"
                dismissible
                elevation="6"
        >
            <div v-html="$store.state.topError.msg"></div>
        </v-alert>
    </div>
</template>

<script>
    export default {
        name: "v-top-error",
        data () {
            return {
                show: true
            }
        },
        methods: {
            alClose () {
                this.$store.commit('setTopError', {
                    show: false,
                    msg: ''
                })
            }
        },
        watch: {
            'show' () {
                this.alClose()
            }
        }
    }
</script>

<style scoped>
    .top_err_box{
        z-index: 1000;
        cursor: pointer;
        padding: 10px 10px 0;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
    }
</style>
